<?php
//include "lib/MyMsServic.php";
//include "lib/MySqlHelper.class.php";

//header("Content-type: text/html; charset=utf-8");
$serverName ="59.50.85.162";
//$dBase="faxtongxiang";
$connectionInfo = array( "Database"=>"faxtongxiang", "UID"=>"dahema", "PWD"=>"tx*123456",'CharacterSet' => "UTF-8" );
$conn = sqlsrv_connect($serverName, $connectionInfo);
if( $conn === false ) {
	echo "<pre>";
	var_dump(sqlsrv_errors());
	exit();
	die( print_r( sqlsrv_errors(), true));
}

//$sql="select [SaleLineID],[Adult],[Child],[beginDate],[lineName] FROM [faxtongxiang].[dbo].[T_saleLine] where beginDate > '2020-12-31 00:00:00' and saleStatue<>'取消' and groupOpType ='散拼'";
//$mymssql = new MyMsServic();
//$mysql = new MySqlHelper();
//echo "<pre>";
//print_r($mymssql);


$sql="select [SaleLineID],[saleStatue],[Adult],[Child],[beginDate],[lineName] FROM [faxtongxiang].[dbo].[T_saleLine] where beginDate > '2020-12-31 00:00:00' and groupOpType = '散拼'";

$stmt = sqlsrv_query($conn,$sql);
//$stmt=$mymssql->exe_msdql($sql);
//if ($stmt===false){
//	die(print_r(sqlsrv_errors(),true));
//}
//$arr=array();
//$i=0;
//$stmt=$mymssql->mGetMsAll($sql);
//print_r($stmt);


//$sql2="select * from orders";
//$res = $mysql->execute_dql($sql2);
//$mysql->getRowsArray($sql);
while($row = sqlsrv_fetch_array($stmt,SQLSRV_FETCH_NUMERIC))
{
   $obj = (array)$row[4];
   echo "<pre>";
    // print_r($row);
    $arr= array($row[0],$row[1],$row[2],$row[3],$obj['date'],$row[5]);
    print_r($arr);
//   array($row[0],$row[1],$row[2],$row[3],$obj['date'],$row[5]))
    //echo $row[0].'*****'.$row[1].'*****'.$row[2].'*****'.$row[3].'*****'.$obj['date'].'*****'.$row[5]."<br>";
}

sqlsrv_free_stmt( $stmt);
